package cn.tedu.shoot;

import javax.imageio.ImageIO;
import java.awt.image.BufferedImage;
import java.io.File;

/**
*@desc  
*@author JokerQiu
*@date 2021/12/05 19:50
*/
public class Images {
    public static BufferedImage sky;
    public static BufferedImage[] heros;
    public static BufferedImage[] airplanes;
    public static BufferedImage bullet;
    static {
        sky = loadImage("images/background.png");
        heros = new BufferedImage[2];
        for(int i=0;i<heros.length;i++){
            heros[i] = loadImage("images/hero"+i+".png");
        }
        airplanes = new BufferedImage[5];
        airplanes[0] = loadImage("images/airplane0.png");
        bullet = loadImage("images/bullet.png");
    }
    public static BufferedImage loadImage(String fileName){
        try{
            BufferedImage img = ImageIO.read(new File(fileName));
            return img;
        }catch(Exception e){
            e.printStackTrace();
            throw new RuntimeException();
        }
    }
}
